package com.cxdr.awsips.packing.bean;

import java.util.Date;

/**
 * @author pugang
 *
 */
public class CheckLog {
	private String ID;
	private String partition_month;
	private Date check_time;
	private String file_name;
	private String file_type;
	private String check_result;
	private String check_desc;
	private String error_file_path;
	private String create_day;
	private String create_hour;
	private String station_ID;
	public CheckLog(String fileName){
		file_name = fileName;
		check_time = new Date();
		create_day = String.valueOf(check_time.getDate());
		create_hour = String.valueOf(check_time.getHours());
		partition_month = check_time.getYear()+"-"+check_time.getMonth();
		parseAttr();
	}
	private void parseAttr(){
		_parseFileNameAttr(file_name);
	}
	private void _parseFileNameAttr(String fileName){
		String[] infos = fileName.split("_");
		for(int i =0;i<infos.length;i++){
			String info = infos[i];
			//站号
			if("I".equalsIgnoreCase(info)){
				info=infos[++i];
				if(info.contains("-REG")){
					info = info.replaceAll("-REG", "");
				}
				station_ID = info;
				continue;
			}
			//文件类型
		}
		if(fileName.contains("O_AWS_FTM")){
			file_type=FileType.E.name();//"地面气象要素数据文件";
		}
		if(fileName.contains("O_AWS-PRF_FTM")){
			file_type=FileType.N.name();//"地面自动站雨量观测资料";
		}
		if(fileName.contains("O_AWS_DAY")){
			file_type=FileType.D.name();//"自动站日数据文件";
		}
		if(fileName.contains("R_AWS_FTM")){
			file_type=FileType.Z.name();//"自动站状态信息文件";
		}
		if(fileName.contains("O_ARS_FTM")){
			file_type=FileType.R.name();//"自动站气象辐射资料";
		}
	}
	public String getID() {
		return ID;
	}
	public void setID(String iD) {
		ID = iD;
	}
	public String getPartition_month() {
		return partition_month;
	}
	public void setPartition_month(String partition_month) {
		this.partition_month = partition_month;
	}
	public Date getCheck_time() {
		return check_time;
	}
	public void setCheck_time(Date check_time) {
		this.check_time = check_time;
	}
	public String getFile_name() {
		return file_name;
	}
	public void setFile_name(String file_name) {
		this.file_name = file_name;
	}
	public String getFile_type() {
		return file_type;
	}
	public void setFile_type(String file_type) {
		this.file_type = file_type;
	}
	public String getCheck_result() {
		return check_result;
	}
	public void setCheck_result(String check_result) {
		this.check_result = check_result;
	}
	public String getCheck_desc() {
		return check_desc;
	}
	public void setCheck_desc(String check_desc) {
		this.check_desc = check_desc;
	}
	public String getError_file_path() {
		return error_file_path;
	}
	public void setError_file_path(String error_file_path) {
		this.error_file_path = error_file_path;
	}
	public String getCreate_day() {
		return create_day;
	}
	public void setCreate_day(String create_day) {
		this.create_day = create_day;
	}
	public String getCreate_hour() {
		return create_hour;
	}
	public void setCreate_hour(String create_hour) {
		this.create_hour = create_hour;
	}
	public String getStation_ID() {
		return station_ID;
	}
	public void setStation_ID(String station_ID) {
		this.station_ID = station_ID;
	}
}
